package edu.zqu.collegeField.framework.easyexcel.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import edu.zqu.collegeField.common.converter.DoorConverter;
import edu.zqu.collegeField.common.enums.DoorEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;

/**
 * @author 廖森
 * @Date 2020/7/17/017.
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class FieldModel {

    @ApiModelProperty(value = "学校id")
    @ExcelIgnore
    private BigInteger collegeId;

    @ApiModelProperty(value = "校区id，关联到school.id")
    @ExcelIgnore
    private BigInteger schoolId;

    @ApiModelProperty(value = "校区id，关联到school.id")
    @ExcelProperty(value = "校区名称",index = 0)
    private String schoolName;

    @ApiModelProperty(value = "场地名称")
    @ExcelProperty(value = "场地名称",index = 1)
    @NotBlank(message = "场地名称不能为空")
    private String name;

    @ApiModelProperty(value = "场地英文名称")
    @ExcelProperty(value = "场地英文名称",index = 2)
    @Pattern(regexp = "^[a-zA-Z\\s]{6,100}$",message = "英文名必须为6-100的英文字母")
    private String englishName;

    @ApiModelProperty(value = "场地类型id，关联到field_type.id")
    @ExcelIgnore
    private Integer fieldTypeId;
    @ApiModelProperty(value = "场地类型名称")
    @ExcelProperty(value = "场地类型",index = 3)
    @NotBlank(message = "场地类型不能为空")
    private String fieldTypeName;

    @ApiModelProperty(value = "功能区id，关联到area.id")
    @ExcelIgnore
    private BigInteger areaId;

    @ApiModelProperty(value = "功能区名称")
    @ExcelProperty(value = "功能区",index = 4)
    @NotBlank(message = "功能区不能为空")
    private String areaName;

    @ApiModelProperty(value = "楼层，有可能是负1层、负2层等等，所以不能用unsigned")
    @ExcelProperty(value = "楼层",index = 5)
    private Integer floor;

    @ApiModelProperty(value = "房间号")
    @ExcelProperty(value = "房间号",index = 6)
    private String room;

    @ApiModelProperty(value = "长度")
    @ExcelProperty(value = "长度",index = 7)
    private BigDecimal length;

    @ApiModelProperty(value = "宽度")
    @ExcelProperty(value = "宽度",index = 8)
    private BigDecimal width;

    @ApiModelProperty(value = "高度")
    @ExcelProperty(value = "高度",index = 9)
    private BigDecimal height;

    @ApiModelProperty(value = "0室内，1室外，2... ")
    @ExcelProperty(value = "室内/室外",converter = DoorConverter.class,index = 10)
    private Integer inOutDoor;

    @ApiModelProperty(value = "最大容纳人数")
    @ExcelProperty(value = "最大容纳人数",index = 11)
    private Integer maxVolumn;

    @ApiModelProperty(value = "描述")
    @ExcelProperty(value = "描述",index = 12)
    private String description;

    @ApiModelProperty(value = "更新时间")
    @ExcelIgnore
    private Date updateTime;

    @ApiModelProperty(value = "操作者")
    @ExcelIgnore
    private BigInteger byWho;
}
